<?php
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require("../member/class/user.php");
$link=db_connect();
$empire=new mysqlquery();
//验证用户
$lur=is_login();
$logininid=(int)$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=(int)$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
//我的状态
$user_r=$empire->fetch1("select pretime,preip,loginnum,preipport from {$dbtbpre}enewsuser where userid='$logininid'");
$gr=$empire->fetch1("select groupname from {$dbtbpre}enewsgroup where groupid='$loginlevel'");
//管理员统计
$adminnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsuser");
$date=date("Y-m-d");
$noplnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewspl_".$public_r['pldeftb']." where checked=1");
//未审核会员
$nomembernum=$empire->gettotal("select count(*) as total from ".eReturnMemberTable()." where ".egetmf('checked')."=0");
//过期广告
$outtimeadnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsad where endtime<'$date' and endtime<>'0000-00-00'");
//签发信息
$qfinfonum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewswfinfo where checktno=0 and (groupid like '%,".$lur['groupid'].",%' or userclass like '%,".$lur['classid'].",%' or username like '%,".$lur['username'].",%')");
//系统信息
	if(function_exists('ini_get')){
        $onoff = ini_get('register_globals');
    } else {
        $onoff = get_cfg_var('register_globals');
    }
    if($onoff){
        $onoff="打开";
    }else{
        $onoff="关闭";
    }
    if(function_exists('ini_get')){
        $upload = ini_get('file_uploads');
    } else {
        $upload = get_cfg_var('file_uploads');
    }
    if ($upload){
        $upload="可以";
    }else{
        $upload="不可以";
    }
	if(function_exists('ini_get')){
        $uploadsize = ini_get('upload_max_filesize');
    } else {
        $uploadsize = get_cfg_var('upload_max_filesize');
    }
	if(function_exists('ini_get')){
        $uploadpostsize = ini_get('post_max_size');
    } else {
        $uploadpostsize = get_cfg_var('post_max_size');
    }
//开启
$register_ok="开启";
if($public_r[register_ok])
{$register_ok="关闭";}
$addnews_ok="开启";
if($public_r[addnews_ok])
{$addnews_ok="关闭";}
//版本
@include("../class/EmpireCMS_version.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>后台管理系统</title>
<link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<link href="adminstyle/<?=$loginadminstyleid?>/wujhadmin.css" rel="stylesheet" type="text/css">
</head>

	<body>
		<div class="system-box">

			<!--用户登录信息-->
			<div class="user-info">
				<div class="user-name">欢迎您
					<?=$loginin?>&nbsp;(
						<?=$gr[groupname]?>) 这是您第 <span class="f-gree"><?=$user_r[loginnum]?></span> 次登录 <span class="f-org"><a href="user/EditPassword.php<?=$ecms_hashur['whehref']?>">修改密码</a></span></div>
				<div class="lasttime">上次登录时间：
					<?=$user_r[pretime]?date('Y-m-d H:i',$user_r[pretime]):'---'?> &nbsp;&nbsp;|&nbsp;&nbsp; 登录IP：
						<?=$user_r[preip]?$user_r[preip].':'.$user_r[preipport]:'---'?>
				</div>
			</div>

			<div class="system-menu">
				<div class="menu-list">
					<div class="hd">
						<span>快捷操作功能</span>
						<div class="clear"></div>
					</div>

					<div class="settings">
						<ul>
							<li>
								<a href="AddInfoChClass.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-2.png" /> 增加信息
								</a>
							</li>
							<li>
								<a href="ListAllInfo.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-3.png" /> 管理信息
								</a>
							</li>
							
							<li>
								<a href="ListClass.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-4.png" /> 管理栏目
								</a>
							</li>

							<li>
								<a href="special/ListZt.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-12.png" />专题管理</a>
							</li>
							
							<li>
								<a href="ReHtml/ChangeData.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-8.png" />数据更新</a>
							</li>
							<li>
								<a href="user/ListLog.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-5.png" />登陆日志</a>
							</li>
							<li>
								<a onclick="window.open('map.php<?=$ecms_hashur['whehref']?>','','width=1250,height=760,scrollbars=auto,resizable=yes,top=80,left=120');" onmouseover="over(this)" onmouseout="out(this)"><img src="adminstyle/1/images/menu/map.png" />后台地图</a>
							</li>
							
						</ul>
					</div>

					<div class="examine">
						<ul>
							<!--<li>
								<a href="tool/gbook.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-10.png" />留言管理</a>
							</li>-->
							<li>
								<a href="tool/feedback.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-11.png" />反馈管理</a>
							</li>
							<li>
								<a href="tool/ListLink.php<?=$ecms_hashur['whehref']?>"><img src="adminstyle/1/images/menu/32x32-9.png" />友链管理</a>
							</li>
						</ul>
					</div>
				</div>

				<div class="data-list" style="display:none;">
					<div class="hd">
						<span>今日信息数据统计</span>
						<div class="clear"></div>
					</div>
					<ul>
						<li>
							<a href="openpage/AdminPage.php?leftfile=<?=urlencode('../pl/PlNav.php'.$ecms_hashur['whehref'])?>&mainfile=<?=urlencode('../pl/ListAllPl.php?checked=2'.$ecms_hashur['ehref'])?>&title=<?=urlencode('管理评论')?><?=$ecms_hashur['ehref']?>">
								<em><?=$noplnum?></em>
								<img src="adminstyle/1/images/menu/system-icon-1.png" />
								<p class="data-num">未审核评论</p>
							</a>
						</li>
						<li>
							<a href="member/ListMember.php?sear=1&schecked=1<?=$ecms_hashur['ehref']?>"><em><?=$nomembernum?></em><img src="adminstyle/1/images/menu/system-icon-2.png" />
								<p class="data-num">未审核会员</a>
						</li>
						<li>
							<a href="tool/ListAd.php?time=1<?=$ecms_hashur['ehref']?>"><em><?=$outtimeadnum?></em><img src="adminstyle/1/images/menu/system-icon-3.png" />
								<p class="data-num">过期广告</a>
						</li>
					</ul>
				</div>
			</div>

			<div class="system-info" style="display:none;">
				<div class="hd">
					<span>网站信息</span>
					<div class="clear"></div>
				</div>

				<p>会员注册：
					<?=$register_ok?>
				</p>
				<p>会员投稿：
					<?=$addnews_ok?>
				</p>
				<p>当前版本：Free
					<?=EmpireCMS_VERSION?>
						<font color="#666666">(
							<?=EmpireCMS_LASTTIME?>)
								<?=EmpireCMS_CHARVER?>
						</font>
				</p>
				<p>上传文件：
					<?=$upload?>
						<font color="#666666">(最大文件：
							<?=$uploadsize?>，表单：
								<?=$uploadpostsize?>)</font>
				</p>
				<p>环境配置：全局变量：
					<?=$onoff?>
						<font color="#666666">(建议关闭)</font> 、魔术引用：
						<?=MAGIC_QUOTES_GPC?'开启':'关闭'?>
							<font color="#666666">(建议开启)</font>
				</p>
				<p>服务器信息：PHP
					<? echo @phpversion();?>/MYSQL
						<? echo @mysql_get_server_info();?>/服务器
							<?=$_SERVER['SERVER_SOFTWARE']?>
				</p>
			</div>
			<!--版权-->
			<div class="copyright">
				技术支持 QQ：289770732 TEL:18108037832
			</div>
			<!--版权End-->
		</div>

		
	</body>

	</html>
	<?php
db_close();
$empire=null;
?>